package sjtu.ist.warehouse4ws.service.cust;

import java.util.List;

import sjtu.ist.warehouse4ws.dao.cust.CustRoleDaoHibernate;
import sjtu.ist.warehouse4ws.model.CustRole;


public class CustRoleServiceImpl implements CustRoleService{
	
	private CustRoleDaoHibernate custRoleDao;


	public void setCustRoleDao(CustRoleDaoHibernate custRoleDao) {
		this.custRoleDao = custRoleDao;
	}


	@Override
	public boolean addCustRole(CustRole role) {
		custRoleDao.save(role);
		// TODO Auto-generated method stub
		return true;
	}


	@Override
	public List<CustRole> getCustRoleListById(String id) {
		// TODO Auto-generated method stub
		return (List<CustRole>)custRoleDao.findById(id);
	}


	@Override
	public List<CustRole> getCustRoleList() {
		// TODO Auto-generated method stub
		return (List<CustRole>) custRoleDao.findAllCustRoles();
		
	}

	@Override
	public List<CustRole> getRoleListbyGroupId(String epcUnitGroupId) {
		// TODO Auto-generated method stub
		return (List<CustRole>) custRoleDao.getRoleListbyGroupId(epcUnitGroupId);
	}
}